classdef LambaIdentification
    properties 
        Rk
        Grad
        eigVals
        eigVects
        Dims
        MaxIterations
    end
    methods
        
        %% we need to look for better way to identify Lamba
        %% Search for that 
      ## To be deleted
        
        function Fit = EvaluateSchlegelLamba(obj,y)            
            Step = zeros(size(obj.Grad));
            for i = 1: obj.Dims                
                Grad_ = obj.eigVects(:,i) * obj.Grad';
                Grad_ = Grad_/(obj.eigVals(i)- y ) ;                
                Step = Step - Grad_' * obj.eigVects(:,i);
            end
            FinalFunc = 0;
            for i = 1: obj.Dims                
                FinalFunc = FinalFunc + Step(i)^2;
            end
            FinalFunc = sqrt(FinalFunc);
            Fit = (FinalFunc - obj.Rk)^2;
        end        
        
     
         
       
    end
end
